/**
 * 
 */
package com.googlecode.pcapj.bridj;

import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Field;

/**
 * 
	struct pcap_pkthdr {
		struct timeval ts;  
		bpf_u_int32 caplen; 
		bpf_u_int32 len;    
	};
	
 */
public class pcap_pkthdr extends StructObject {
    public pcap_pkthdr() { super(); }
    public pcap_pkthdr(Pointer<? extends StructObject> pointer) { super(pointer); }

    /**
     * 
     * @return
     */
    @Field(0) 
    public timeval ts() {
            return this.io.getNativeObjectField(this, 0);
    }
    
    /**
     * 
     * @param ts
     * @return
     */
    @Field(0) 
    public pcap_pkthdr tv_sec(timeval ts) {
            this.io.setNativeObjectField(this, 0, ts);
            return this;
    }
    
    /**
     * 
     * @return
     */
    @Field(1) 
    public int caplen() {
            return this.io.getIntField(this, 1);
    }
    /**
     * 
     * @param caplen
     * @return
     */
    @Field(1) 
    public pcap_pkthdr caplen(int caplen) {
            this.io.setIntField(this, 1, caplen);
            return this;
    }
    
    /**
     * 
     * @return
     */
    @Field(2) 
    public int len() {
            return this.io.getIntField(this, 2);
    }
    /**
     * 
     * @param len
     * @return
     */
    @Field(2) 
    public pcap_pkthdr len(int len) {
            this.io.setIntField(this, 2, len);
            return this;
    }
}
